clear; clc; getSession;
%%
zs = sess.getZIServer;
plt = zs.plotterModule('plt');
%%
plt.initialize();
plt.setRate(100); % sampling rate [Sa/s]
plt.setTimeGrid(10); % total duration [s]
plt.subscribe('dev3543', ziDemod1.X,   [2, 1, 1]);
plt.subscribe('dev3543', ziDemod2.DIO, [2, 1, 1]);
plt.subscribe('dev3560', ziPID3.Error, [2, 1, 2]);
res=plt.run();
plt.unsubscribe();
res.plot_data('dev3543', ziDemod1.X)

%%
plt.initialize();
plt.setRate(1000);
plt.setTimeGrid(10);
plt.subscribe('dev3543', ziDemod1.X,   [2, 2, 1]);
plt.subscribe('dev3543', ziDemod2.DIO, [2, 2, 2]);
plt.subscribe('dev3560', ziPID3.Error, [2, 2, 3]);
plt.setTrigger('dev3543', ziDemod1.TrigIn1, 'edge', ziEnumTrigEdgeSlope.Both, 'count', 5); 
res=plt.run();
